package com.yl.chainStore.entity.pay

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.yl.chainStore.common.enums.CustomerShowEnum
import com.yl.common.annotation.NoArg
import com.yl.common.getContext

/**
 * <p>
 *
 * </p>
 *
 * @author cxw
 * @since 2021-10-18
 */
@NoArg
@TableName("pay_item_customer_show_rule")
data class PayItemCustomerShowRule(

	@TableId(value = "id", type = IdType.AUTO)
	val id: Long,

	/**
	 * 项目id
	 */
	@TableField(value = "item_id")
	var itemId: Long,

	@TableField(exist = false)
	var itemName: String? = null,

	@TableField(exist = false)
	var nickname: String? = null,

	@TableField(exist = false)
	var showLabel: String? = null,



	/**
	 * 分院id
	 */
	@TableField("sub_company_id")
	var subCompanyId: Long = getContext().subCompanyId,

	/**
	 * 项目时间
	 */
	@TableField("time_of_day")
	var timeOfDay: Int = 0,

	/**
	 * 显示类型
	 */
	@TableField("show_type")
	var showType: CustomerShowEnum,



	/**
	 * 排序（重要性）
	 */
	@TableField("order_num")
	var orderNum: Int = 1

){
	@TableField(exist = false)
	var showTypeIntValue:Int?=null
	set(value) {
		showType = CustomerShowEnum.getEnum(value)
	}
}
